home *** CD-ROM | disk | FTP | other *** search
/ Kit PC World De Ampliacion De Windows 95 / Kit PC World de ampliacion de Windows 95.iso / internet / sweeper / samples / olecon~1 / controls / webbit~1 / webbit~1.cpp < prev    next >
C/C++ Source or Header  |  1995-12-05  |  6KB  |  205 lines

  1. //=--------------------------------------------------------------------------=
  2. // WebBitmap.Cpp
  3. //=--------------------------------------------------------------------------=
  4. // Copyright  1995  Microsoft Corporation.  All Rights Reserved.
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 
  9. // PARTICULAR PURPOSE.
  10. //=--------------------------------------------------------------------------=
  11. //
  12. // various routines et all that aren't in a file for a particular automation
  13. // object, and don't need to be in the generic ole automation code.
  14. //
  15. #define INITOBJECTS                // define the descriptions for our objects
  16.  
  17. #include "IPServer.H"
  18. #include "LocalSrv.H"
  19.  
  20.  
  21. #include "LocalObj.H"
  22. #include "CtrlObj.H"
  23. #include "Globals.H"
  24. #include "Util.H"
  25. #include "Resource.H"
  26.  
  27. #include "WebBitmapCtl.H"
  28. #include "WebBitmapPPG.H"
  29.  
  30. // needed for ASSERTs and FAIL
  31. //
  32. SZTHISFILE
  33.  
  34. //=--------------------------------------------------------------------------=
  35. // our Libid.  This should be the LIBID from the Type library, or NULL if you
  36. // don't have one.
  37. //
  38. const CLSID *g_pLibid = &LIBID_WebBitmapObjects;
  39.  
  40.  
  41. //=--------------------------------------------------------------------------=
  42. // Localization Information
  43. //
  44. // We need the following two pieces of information:
  45. //    a. whether or not this DLL uses satellite DLLs for localization.  if
  46. //       not, then the lcidLocale is ignored, and we just always get resources
  47. //       from the server module file.
  48. //    b. the ambient LocaleID for this in-proc server.  Controls calling
  49. //       GetResourceHandle() will set this up automatically, but anybody
  50. //       else will need to be sure that it's set up properly.
  51. //
  52. VARIANT_BOOL    g_fSatelliteLocalization =  FALSE;
  53. LCID            g_lcidLocale = MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT);
  54.  
  55.  
  56. //=--------------------------------------------------------------------------=
  57. // your license key and where under HKEY_CLASSES_ROOT_LICENSES it's sitting
  58. //
  59. WCHAR g_wszLicenseKey [] = L"";
  60. WCHAR g_wszLicenseLocation [] = L"";
  61.  
  62.  
  63. //=--------------------------------------------------------------------------=
  64. // This Table describes all the automatible objects in your automation server.
  65. // See AutomationObject.H for a description of what goes in this structure
  66. // and what it's used for.
  67. //
  68. OBJECTINFO g_ObjectInfo[] = {
  69.     CONTROLOBJECT(WebBitmap),
  70.     PROPERTYPAGE(WebBitmapGeneral),
  71.     EMPTYOBJECT
  72. };
  73.  
  74. char g_szLibName[] = "WebBitmap";
  75.  
  76. //=--------------------------------------------------------------------------=
  77. // IntializeLibrary
  78. //=--------------------------------------------------------------------------=
  79. // called from DllMain:DLL_PROCESS_ATTACH.  allows the user to do any sort of
  80. // initialization they want to.
  81. //
  82. // Notes:
  83. //
  84. void InitializeLibrary
  85. (
  86.     void
  87. )
  88. {
  89.     // TODO: initialization here.  control window class should be set up in
  90.     // RegisterClassData.
  91. }
  92.  
  93. //=--------------------------------------------------------------------------=
  94. // UninitializeLibrary
  95. //=--------------------------------------------------------------------------=
  96. // called from DllMain:DLL_PROCESS_DETACH.  allows the user to clean up anything
  97. // they want.
  98. //
  99. // Notes:
  100. //
  101. void UninitializeLibrary
  102. (
  103.     void
  104. )
  105. {
  106.     // TODO: uninitialization here.  control window class will be unregistered
  107.     // for you, but anything else needs to be cleaned up manually.
  108.     // Please Note that the Window 95 DLL_PROCESS_DETACH isn't quite as stable
  109.     // as NT's, and you might crash doing certain things here ...
  110. }
  111.  
  112.  
  113. //=--------------------------------------------------------------------------=
  114. // CheckForLicense
  115. //=--------------------------------------------------------------------------=
  116. // users can implement this if they wish to support Licensing.  otherwise,
  117. // they can just return TRUE all the time.
  118. //
  119. // Parameters:
  120. //    none
  121. //
  122. // Output:
  123. //    BOOL            - TRUE means the license exists, and we can proceed
  124. //                      FALSE means we're not licensed and cannot proceed
  125. //
  126. // Notes:
  127. //    - implementers should use g_wszLicenseKey and g_wszLicenseLocation
  128. //      from the top of this file to define their licensing [the former
  129. //      is necessary, the latter is recommended]
  130. //
  131. BOOL CheckForLicense
  132. (
  133.     void
  134. )
  135. {
  136.     // TODO: decide whether or not your server is licensed in this function.
  137.     // people who don't want to bother with licensing should just return
  138.     // true here always.  g_wszLicenseKey and g_wszLicenseLocation are
  139.     // used by IClassFactory2 to do some of the licensing work.
  140.     //
  141.     return TRUE;
  142. }
  143.  
  144. //=--------------------------------------------------------------------------=
  145. // RegisterData
  146. //=--------------------------------------------------------------------------=
  147. // lets the inproc server writer register any data in addition to that in
  148. // any other objects.
  149. //
  150. // Output:
  151. //    BOOL            - false means failure.
  152. //
  153. // Notes:
  154. //
  155. BOOL RegisterData
  156. (
  157.     void
  158. )
  159. {
  160.     // TODO: register any additional data here that you might wish to.
  161.     //
  162.     return TRUE;
  163. }
  164.  
  165. //=--------------------------------------------------------------------------=
  166. // UnregisterData
  167. //=--------------------------------------------------------------------------=
  168. // inproc server writers should unregister anything they registered in
  169. // RegisterData() here.
  170. //
  171. // Output:
  172. //    BOOL            - false means failure.
  173. //
  174. // Notes:
  175. //
  176. BOOL UnregisterData
  177. (
  178.     void
  179. )
  180. {
  181.     // TODO: any additional registry cleanup that you might wish to do.
  182.     //
  183.     return TRUE;
  184. }
  185.  
  186.  
  187. //=--------------------------------------------------------------------------=
  188. // CRT stubs
  189. //=--------------------------------------------------------------------------=
  190. // these two things are here so the CRTs aren't needed. this is good.
  191. //
  192. // basically, the CRTs define this to suck in a bunch of stuff.  we'll just
  193. // define them here so we don't get an unresolved external.
  194. //
  195. // TODO: if you are going to use the CRTs, then remove this line.
  196. //
  197. extern "C" int __cdecl _fltused = 1;
  198.  
  199. extern "C" int _cdecl _purecall(void)
  200. {
  201.   FAIL("Pure virtual function called.");
  202.   return 0;
  203. }
  204.  
  205.